package com.ktgj.service.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ktgj.common.log.annotation.Log;
import com.ktgj.common.log.enums.BusinessType;
import com.ktgj.common.security.annotation.PreAuthorize;
import com.ktgj.service.domain.OrderChannelViphall;
import com.ktgj.service.service.IOrderChannelViphallService;
import com.ktgj.common.core.web.controller.BaseController;
import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.common.core.utils.poi.ExcelUtil;
import com.ktgj.common.core.web.page.TableDataInfo;

/**
 * 鲸图厅设备验证进厅记录Controller
 * 
 * @author ruoyi
 * @date 2021-09-03
 */
@ControllerAdvice
@RestController
@RequestMapping("/orderchannelviphall")
public class OrderChannelViphallController extends BaseController
{
    @Autowired
    private IOrderChannelViphallService orderChannelViphallService;

    /**
     * 查询鲸图厅设备验证进厅记录列表
     */
    //@PreAuthorize(hasPermi = "service:viphall:list")
    @GetMapping("/list")
    public TableDataInfo list(OrderChannelViphall orderChannelViphall)
    {
        startPage();
        List<OrderChannelViphall> list = orderChannelViphallService.selectOrderChannelViphallList(orderChannelViphall);
        return getDataTable(list);
    }

    /**
     * 导出鲸图厅设备验证进厅记录列表
     */
    //@PreAuthorize(hasPermi = "service:viphall:export")
    @Log(title = "鲸图厅设备验证进厅记录 ", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, OrderChannelViphall orderChannelViphall) throws IOException
    {
        List<OrderChannelViphall> list = orderChannelViphallService.selectOrderChannelViphallList(orderChannelViphall);
        ExcelUtil<OrderChannelViphall> util = new ExcelUtil<OrderChannelViphall>(OrderChannelViphall.class);
        util.exportExcel(response, list, "鲸图厅设备验证进厅记录 数据");
    }

    /**
     * 获取鲸图厅设备验证进厅记录详细信息
     */
    //@PreAuthorize(hasPermi = "service:viphall:query")
    @GetMapping(value = "/{orderId}")
    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
    {
        return AjaxResult.success(orderChannelViphallService.selectOrderChannelViphallById(orderId));
    }

    /**
     * 新增鲸图厅设备验证进厅记录
     */
    //@PreAuthorize(hasPermi = "service:viphall:add")
    @Log(title = "鲸图厅设备验证进厅记录 ", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody OrderChannelViphall orderChannelViphall)
    {
        return toAjax(orderChannelViphallService.insertOrderChannelViphall(orderChannelViphall));
    }

    /**
     * 修改鲸图厅设备验证进厅记录
     */
    //@PreAuthorize(hasPermi = "service:viphall:edit")
    @Log(title = "鲸图厅设备验证进厅记录 ", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody OrderChannelViphall orderChannelViphall)
    {
        return toAjax(orderChannelViphallService.updateOrderChannelViphall(orderChannelViphall));
    }

    /**
     * 删除鲸图厅设备验证进厅记录
     */
    //@PreAuthorize(hasPermi = "service:viphall:remove")
    @Log(title = "鲸图厅设备验证进厅记录 ", businessType = BusinessType.DELETE)
	@DeleteMapping("/{orderIds}")
    public AjaxResult remove(@PathVariable Long[] orderIds)
    {
        return toAjax(orderChannelViphallService.deleteOrderChannelViphallByIds(orderIds));
    }
}
